<template>
  <van-nav-bar title="线索详情" left-text="返回" left-arrow @click-left="onClickLeft" />
  <div class="abc" style="p-10">

    <p>疑似失踪人: {{ item.name }}</p>
    <p>性别：{{ item.sex == 1 ? '男' : '女' }}</p>
    <p>特征描述：{{ item.description ? item.description : '在人民广场南侧的垃圾桶发现，湖南口音，皮肤比较黑，长头发，眼睛大。' }} </p>
    <p>发现时间：{{ item.findtime ? item.findtime : '2022年3月30日' }} </p>
    <p>发现地点：{{ item.detailed_address ? item.detailed_address : '上海市浦东新区昌里路358号'}}</p>
    <p>是否匿名提供线索：是</p>
    <img :src="item.photo" style="my-4" />
  </div>


</template>
<script>
import { useRouter, useRoute } from 'vue-router'
import axios from 'axios'
import Cookie from 'js-cookie'
import { ref } from 'vue'
export default {
  setup() {
    const item = ref({})
    const onClickLeft = () => history.back()
    const route = useRoute()
    const type = route.query.type
    const url = type == 'relative' ? 'relative' : 'clues'
    axios.get(`/mock/${url}`).then(res => {
      console.log(res.data)
      const id = route.query.id
      res.data.data.push(JSON.parse(Cookie.get('clueList')));
      item.value = res.data.data.find(i => i.id == id)
    })
    return {
      item,
      onClickLeft
    }
  }
}

// const app = createApp()
// app.use(SwipeCell)
</script>
<style scoped>
.abc {
  display: block;
  padding: 20px;
}

p {
  line-height: 35px;
  font-size: 18px;
}

img {
  margin-top: 15px;
}
</style>
